#ifndef CIPODEVENT_H_
#define CIPODEVENT_H_

#include "CIpodLib.h"

#ifdef __cplusplus
extern "C"{
#endif

typedef enum {
    IPOD_EVT_CONNECT_STATUS_CHANGED,
    IPOD_EVT_A2DP_STATUS_CHANGED,
    IPOD_EVT_SAMPLE_RATE_CHANGED,
    IPOD_EVT_TRACK_CHANGED,
    IPOD_EVT_TRACK_POSITION_CHANGED,
    IPOD_EVT_TRACK_DURATION_CHANGED,
    IPOD_EVT_SHUFFLE_MODE_CHANGED,
    IPOD_EVT_REPEAT_MODE_CHANGED,
    IPOD_EVT_PLAYBACK_STATE_CHANGED,
    IPOD_EVT_ALBUM_ARTWORK_CHANGED,
    IPOD_EVT_MEDIA_UPDATE_PROGRESS,
    IPOD_EVT_EA_DATA_RECEIVED,
    IPOD_EVT_EA_NATIVE_STATE_CHANGED,
    IPOD_EVT_DEVICE_INFORMATION_UPDATE,
    IPOD_EVT_FILE_MUSIC_RADIO_PATH,
    IPOD_EVT_FILE_MUSIC_LOCAL_DEVICE_PATH,
    IPOD_EVT_CALL_STATUS_CHANGED,
    IPOD_EVT_LOCATION_ENABLE_CHANGED,
    IPOD_EVT_DEVICE_TRANSPORTID_CHANGED,
    IPOD_EVT_WIRELESS_CARPLAY_AVAILABLE_CHANGED,
    IPOD_EVT_ROUTE_GUIDANCE_CHANGED,
    IPOD_EVT_ROUTE_GUIDANCE_MANEUVER_CHANGED,
    IPOD_EVT_DEVICE_MAC_ADDRESS,
    IPOD_EVT_DEVICE_LINK_KEY_INFORMATION,
    IPOD_EVT_CARPLAY_AVAILABILITY_INFORMATION,
    IPOD_EVT_MEDIA_PLAYING_LIST_CHANGED,
    IPOD_EVT_PLAYBACK_QUEUELIST_AVAILABLE,
    IPOD_EVT_LOCATION_INFO_CHANGED,
} IPODEventID;

class CIpodEvent {
public:
    static void registerObserver(IPODObserver *observer);
    static void unregisterObserver();
    static void sendEvent(IPODEventID id, ipod_t handle);
    static void sendEvent(IPODEventID id, ipod_t handle, int param);
    static void sendEvent(IPODEventID id, ipod_t handle, const void *obj);
    static void sendEvent(IPODEventID id, ipod_t handle, int param, const void *obj);
    //反向CarPlay读写数据
    static int read(ipod_t handle, uint8 *data, uint16 len,int* length);
    static int write(ipod_t handle, uint8 *data, uint16 len,int* length);
    static int accessoryVidPid(ipod_t handle, void *vid, void *pid);
    static int reportCallEvent(ipod_t handle, int keyCode,int keyAction);
    static int startHID(ipod_t handle, uint8 *data, uint16 len);
    static int hidReport(ipod_t handle, uint8 *data, uint16 len);
    static int wifiConfigurationInformation(ipod_t handle, void *data);
    static int httpInfoReport(ipod_t handle, void *ipAddress, int port,void * srcVersion,void * deviceID,void * publicKey);
    static int publish_shark_bonjour();
    static int identificationInfo();
    static int request_shark_deviceId(uint8 *data, uint16 len);

private:
    static IPODObserver *s_Observer;


};
#ifdef __cplusplus
}
#endif
#endif /* CIPODEVENT_H_ */
